﻿using System;
using System.Collections.Generic;
using System.Text;

namespace cefsharpcore7_ch2
{
    /// <summary>
    /// ref 参数修饰符，传地址，p 和 x指向同一块内存位置。
    /// </summary>
    class RefKeyWordExample1
    {
        static void Foo(ref int p)
        {
            p = p + 1;
            Console.WriteLine(p);
        }
        static void _Main() {
            int x = 8;
            Foo(ref x);
            Console.WriteLine(x); // x is now 9
        }
    }
   
    
}
